import pygame

info = {
    "name":"XToolsBox Plus",
    "version":"1.0",
    "info":"XToolsBox Plus 核心插件",
    "by":["This is XiaoDeng"]
}
screen = None
bg = (0,0,0)

class plugin():
    def __init__(self,api,log):
        global screen
        self.log = log
        self.api = api
        self.verid = self.api.getglobalvalue("verid")
        if int(self.api.get_publicdata("xtblastid",self.verid)) > self.verid:
            self.log(f"""检测到更新：XToolsBox+ {self.api.get_publicdata("latest",self.ver)} 已更新
更新日志：
{self.api.get_publicdata("xtbChangeLog")}

为了保证您的体验，请尽快升级到最新版本
我们不会为 XToolsBox+ 老版本提供任何支持信息！
""")
        elif int(self.api.get_publicdata("xtblastid",self.verid)) < self.verid:
            self.api.set_publicdata("xtblastid",self.verid)
        #screen = self.api.addpage("<default>",defaultpage,f"{self.api.getpath('./tb')}/launch.png")
    def onEvent(self,event):
        if event.type == pygame.QUIT:
            self.api.setglobalvalue("run",False)
